using System;
using System.Data;
using System.Configuration;
using System.Collections;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;
using NiSis.Data;
using NiSis.Entities;


namespace NiSis
{
    public partial class UtenzeNoPool : System.Web.UI.Page
    {
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!Page.IsPostBack)
            {
                lblTitle.Text = string.Format("{0}  {1}", lblTitle.Text,CustomUtil.DataInverter( Request["CdMese"] ?? "(tutti)")); 
                LoadUt(Request["CdMese"] ?? string.Empty);
            }
        }
        protected void LoadUt(string cdMese)
        {
            string strWhere = string.Empty;
            if (cdMese==string.Empty)
                strWhere=string.Format("cd_mese_inizio_fornitura='{0}'", cdMese);

            VList<VUtenzePoolNonDefinito> ut = DataRepository.VUtenzePoolNonDefinitoProvider.Get(
               strWhere , "ds_cliente");

            grdUtNoPool.DataSource = ut;
            grdUtNoPool.DataBind();
        }
    }
}
